<?php

/**
 * User Hook helps create page view.
 *
 * PHP versions 5
 * CAKEPHP versions 2.x
 * 
 * Green CMS - Content Management System and Framework Powerfull by Cakephp
 * Copyright 2012, GREEN GLOBAL CO., LTD (toancauxanh.vn)
 * 
 * CakePHP(tm) :  Rapid Development Framework (http://www.cakephp.org)
 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @author        Technology Lab No.I <tech1@toancauxanh.vn>
 * @link          
 * @package       User.Helper
 * @since         Green v 1.0
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
class UserHookHelper extends AppHelper {

    /**
     * Block Hook
     *
     * @param string $delta
     * @param array $block
     * @param array $params
     * @param array $menus
     * 
     * @return void
     */
    public function block($block, $params, $options) {
        $element = '';
        switch ($block['delta']) {
            case 'login': {
                    $element = 'login';
                    $block['title'] = __('green', 'User Login');
                    break;
                }
        }
        $block['content'] = $this->_View->element('User.Block' . DS . $element, compact('block', 'params'), $options);
    }

    /**
     * Returns a list of events this object is implementing, when the class is registered
     * in an event manager, each individual method will be associated to the respective event.
     *
     * @return array associative array or event key names pointing to the function
     * that should be called in the object when the respective event is fired
     */
    public function implementedEvents() {
        return array(
            'Helper.Layout.User.block' => 'block'
        );
    }

}
